﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace SolverOptimizationAPI.Controllers
{
    public class MyPostObject
    {
        public String Color { get; set; }
        public int Weight { get; set; }
        public List<MyOtherPostObject> MyObjects { get; set; }
    }

    public class MyOtherPostObject
    {
        public String Value { get; set; }
        public Dictionary<String, double> MyValues { get; set; }
    }

    public class ValuesController : ApiController
    {
        // GET api/values
        public MyPostObject Get()
        {
            var myObj = new MyPostObject();
            myObj.Color = "green";
            myObj.Weight = 17;
            myObj.MyObjects = new List<MyOtherPostObject>();
            var otherPostObj1 = new MyOtherPostObject();
            otherPostObj1.Value = "derpyderp";
            otherPostObj1.MyValues = new Dictionary<string, double>();
            otherPostObj1.MyValues["tee"] = 0.0032;
            otherPostObj1.MyValues["foo"] = 4343.88;
            myObj.MyObjects.Add(otherPostObj1);
            var postObj2 = new MyOtherPostObject();
            postObj2.Value = "preeeeow";
            postObj2.MyValues = new Dictionary<string, double>();
            postObj2.MyValues["asdf"] = 43343.22343;
            postObj2.MyValues["qwer"] = 0.0000000034388;
            myObj.MyObjects.Add(postObj2);


            return myObj;
        }

        // GET api/values/5
        public string Get(int id)
        {
            return "value";
        }

        // POST api/values
        public void Post(MyPostObject value)
        {
            var i = 0;
        }

        // PUT api/values/5
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE api/values/5
        public void Delete(int id)
        {
        }
    }
}